package base.utils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

/**
 * 取配置文件内容
 * 
 * @author Administrator
 * 
 */
public class PropertiesUtils implements Serializable {

	public static Map<String, String> getPropertiesMap(String path) {
		Map<String, String> map = new HashMap<String, String>();
		ResourceBundle rb = ResourceBundle.getBundle(path);
		String key = "";
		while ((key = rb.getKeys().nextElement()) != null) {
			map.put(key, rb.getString(key));
		}
		return map;

	}

	public static String getPropertiesValue(String key, String path) {
		ResourceBundle rb = ResourceBundle.getBundle(path);
		return rb.getString(key);
	}

}
